import {PageContainer} from '@ant-design/pro-components';
import React, {useEffect} from 'react';
import AMapLoader from '@amap/amap-jsapi-loader'
import {Card} from "antd";

let map

export default () => {

  useEffect(() => {
    AMapLoader.load({
      key: "ec163362391a3d3af59d4a54fef6648e",                     // 申请好的Web端开发者Key，首次调用 load 时必填
      version: "2.0",              // 指定要加载的 JSAPI 的版本，缺省时默认为 1.4.15
      plugins: [''],               // 需要使用的的插件列表，如比例尺'AMap.Scale'等
    }).then((AMap) => {
      map = new AMap.Map("container", { //设置地图容器id
        // viewMode: "3D",         //是否为3D地图模式
        zoom: 11,                //初始化地图级别
        // center: [105.602725, 37.076636], //初始化地图中心点位置
      });
    }).catch(e => {
      console.log(e);
    })
  })

  return <PageContainer header={{title: '', breadcrumb: {},}}>
    <Card>
      <div id="container" style={{height: '70vh'}}></div>
    </Card>
  </PageContainer>
}
